package com.chukun.tx.model;


import com.chukun.tx.dto.OrderDto;
import org.springframework.beans.BeanUtils;

import java.math.BigDecimal;

/**
 * @author chukun
 *  订单相关的属性
 */
public class Order {

    private Long orderId;
    private String orderNo;
    private String goodsName;
    private BigDecimal orderPrice;

    public Long getOrderId() {
        return orderId;
    }

    public void setOrderId(Long orderId) {
        this.orderId = orderId;
    }

    public String getOrderNo() {
        return orderNo;
    }

    public void setOrderNo(String orderNo) {
        this.orderNo = orderNo;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public BigDecimal getOrderPrice() {
        return orderPrice;
    }

    public void setOrderPrice(BigDecimal orderPrice) {
        this.orderPrice = orderPrice;
    }

    @Override
    public String toString() {
        return "Order{" +
                "orderId=" + orderId +
                ", orderNo='" + orderNo + '\'' +
                ", goodsName='" + goodsName + '\'' +
                ", orderPrice=" + orderPrice +
                '}';
    }

    /**
     * orderDto 转换为 Do
     * @param orderDto
     */
    public void oderDto2Do(OrderDto orderDto) {
        BeanUtils.copyProperties(orderDto,this);
    }
}
